﻿using System;
using UnityEngine;

namespace Valve.VR.InteractionSystem
{
	// Token: 0x020005F5 RID: 1525
	[RequireComponent(typeof(CapsuleCollider))]
	public class BodyCollider : MonoBehaviour
	{
		// Token: 0x060026E5 RID: 9957 RVA: 0x000E3048 File Offset: 0x000E1248
		private void Awake()
		{
			this.capsuleCollider = base.GetComponent<CapsuleCollider>();
		}

		// Token: 0x060026E6 RID: 9958 RVA: 0x000E3058 File Offset: 0x000E1258
		private void FixedUpdate()
		{
			float num = Vector3.Dot(this.head.localPosition, Vector3.up);
			this.capsuleCollider.height = Mathf.Max(this.capsuleCollider.radius, num);
			base.transform.localPosition = this.head.localPosition - 0.5f * num * Vector3.up;
		}

		// Token: 0x040026D6 RID: 9942
		public Transform head;

		// Token: 0x040026D7 RID: 9943
		private CapsuleCollider capsuleCollider;
	}
}
